from rest_framework.serializers import ModelSerializer, StringRelatedField

from Scenes.serializers import TestSceneSerializer
from .models import TestTask, TestReport, TestRecord


class TestTaskSerializer(ModelSerializer):
    class Meta:
        model = TestTask
        fields = "__all__"


class TestTaskSceneSerializer(ModelSerializer):
    scene = TestSceneSerializer(many=True)

    class Meta:
        model = TestTask
        fields = "__all__"


class TestRecordSerializer(ModelSerializer):
    env = StringRelatedField(read_only=True)
    task = StringRelatedField(read_only=True)
    class Meta:
        model = TestRecord
        fields = "__all__"


class TestReportSerializer(ModelSerializer):
    class Meta:
        model = TestReport
        fields = "__all__"
